In [2]:
# Setup
import scanpy as sc
import scvelo as scv
import anndata
import loompy
import mygene
import scipy
import seaborn as sns
import matplotlib.pyplot as plt
from VelocityObject import VelocityObject
import pandas as pd
In [2]:
# Creating object for IntegratedMultimodal_CITEseq with ALL TIME POINTS
h5ad_path = "/Volumes/PortableSSD/SRSP/IntegratedMultimodal_CITEseq.h5ad"
loom_paths = ["/Volumes/PortableSSD/SRSP/YS001/possorted_genome_bam_KLWV0.loom",
"/Volumes/PortableSSD/SRSP/YS002/possorted_genome_bam_PNEM4.loom",
"/Volumes/PortableSSD/SRSP/YS003/possorted_genome_bam_8Q2XV.loom",
"/Volumes/PortableSSD/SRSP/YS004/possorted_genome_bam_0XB2N.loom",
"/Volumes/PortableSSD/SRSP/YS005/possorted_genome_bam_HX08G.loom",
"/Volumes/PortableSSD/SRSP/YS006/possorted_genome_bam_751VB.loom"]
citeSEQ_all = VelocityObject(h5ad_path, loom_paths)
WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:biothings.client:Input sequence provided is already in string format. No operation performed WARNING:biothings.client:Input sequence provided is already in string format. No operation performed INFO:biothings.client:querying 1-248 ...
==== Converting ENSEMBL Genes ==== Total ldata genes: 33696 ENSEMBL-like genes: 248 Already-symbol-like genes: 33448
INFO:biothings.client:Finished. WARNING:biothings.client:13 input query terms found no hit: ['ENSMUSG00000095742', 'ENSMUSG00000095728', 'ENSMUSG00000095076', 'ENSMUSG00000121317', 'ENSMUSG000 INFO:biothings.client:Pass "returnall=True" to return complete lists of duplicate or missing query terms.
Mapped ENSMUSG → symbol: 203 Unmapped ENSMUSG: 45 Total ENSMUSG IDs after mapping: 45 === Removing duplicates === adata Cells (original): 35317 Genes (original): 30481 Duplicate cell barcodes: 144 Duplicate genes: 0 ldata Cells (original): 45487 Genes (original): 33696 Duplicate cell barcodes: 235 Duplicate genes: 27 adata after dedup: (35173, 30481) ldata after dedup: (45252, 33696) === Subsetting cells by GENES and BARCODES === Overlapping Cells: 34946 Overlapping genes: 29365 adata shape: (34946, 29365) ldata shape: (34946, 29365) Cells match: True Genes match: True Layers in adata_subset: ['spliced', 'unspliced', 'ambiguous'] Spliced shape: (34946, 29365) Unspliced shape: (34946, 29365) === Seurat-derived AnnData (adata) === Cells (obs): 34946 Genes (var): 29365 First 10 cell names: ['AAACCCAAGAACAGGA', 'AAACCCAAGATACAGT', 'AAACCCAAGCAATAGT', 'AAACCCAAGCGCCTAC', 'AAACCCAAGCTAGTTC', 'AAACCCAAGGTACCTT', 'AAACCCAAGTATCTGC', 'AAACCCAAGTCTCTGA', 'AAACCCACAACCCTAA', 'AAACCCACAAGAAATC'] First 10 gene names: ['Xkr4', 'Gm19938', 'Sox17', 'Mrpl15', 'Lypla1', 'Tcea1', 'Rgs20', 'Atp6v1h', 'Npbwr1', '4732440D04Rik'] === Loom Spliced/Unspliced Data (ldata) === Cells (obs): 34946 Genes (var): 29365 First 10 cell names: ['AAACCCAAGAACAGGA', 'AAACCCAAGATACAGT', 'AAACCCAAGCAATAGT', 'AAACCCAAGCGCCTAC', 'AAACCCAAGCTAGTTC', 'AAACCCAAGGTACCTT', 'AAACCCAAGTATCTGC', 'AAACCCAAGTCTCTGA', 'AAACCCACAACCCTAA', 'AAACCCACAAGAAATC'] First 10 gene names: ['Xkr4', 'Gm19938', 'Sox17', 'Mrpl15', 'Lypla1', 'Tcea1', 'Rgs20', 'Atp6v1h', 'Npbwr1', '4732440D04Rik'] Layer Shapes in ldata spliced: (34946, 29365) unspliced: (34946, 29365) ambiguous: (34946, 29365) VelocityObject initialized successfully.
In [17]:
h5ad_path_keratinocytes_all = "/Volumes/PortableSSD/SRSP/KeratinocytesAnnotated_CITEseq.h5ad"
h5ad_path_keratinocytes_uw = "/Volumes/PortableSSD/SRSP/Keratinocytes_UW.h5ad"
h5ad_path_keratinocytes_wo = "/Volumes/PortableSSD/SRSP/Keratinocytes_WO.h5ad"
loom_paths = ["/Volumes/PortableSSD/SRSP/YS001/possorted_genome_bam_KLWV0.loom",
"/Volumes/PortableSSD/SRSP/YS002/possorted_genome_bam_PNEM4.loom",
"/Volumes/PortableSSD/SRSP/YS003/possorted_genome_bam_8Q2XV.loom",
"/Volumes/PortableSSD/SRSP/YS004/possorted_genome_bam_0XB2N.loom",
"/Volumes/PortableSSD/SRSP/YS005/possorted_genome_bam_HX08G.loom",
"/Volumes/PortableSSD/SRSP/YS006/possorted_genome_bam_751VB.loom"]
#citeSEQ_keratinocytes = VelocityObject(h5ad_path_keratinocytes_all, loom_paths)
citeSEQ_keratinocytes_uw = VelocityObject(h5ad_path_keratinocytes_uw, loom_paths)
#citeSEQ_keratinocytes_wo = VelocityObject(h5ad_path_keratinocytes_wo, loom_paths)
WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471 WARNING:biothings.client:Input sequence provided is already in string format. No operation performed WARNING:biothings.client:Input sequence provided is already in string format. No operation performed INFO:biothings.client:querying 1-248 ...
==== Converting ENSEMBL Genes ==== Total ldata genes: 33696 ENSEMBL-like genes: 248 Already-symbol-like genes: 33448
INFO:biothings.client:Finished. WARNING:biothings.client:13 input query terms found no hit: ['ENSMUSG00000095742', 'ENSMUSG00000095728', 'ENSMUSG00000095076', 'ENSMUSG00000121317', 'ENSMUSG000 INFO:biothings.client:Pass "returnall=True" to return complete lists of duplicate or missing query terms.
Mapped ENSMUSG → symbol: 203 Unmapped ENSMUSG: 45 Total ENSMUSG IDs after mapping: 45 === Removing duplicates === adata Cells (original): 6317 Genes (original): 30481 Duplicate cell barcodes: 0 Duplicate genes: 0 ldata Cells (original): 45487 Genes (original): 33696 Duplicate cell barcodes: 235 Duplicate genes: 27 adata after dedup: (6317, 30481) ldata after dedup: (45252, 33696) === Subsetting cells by GENES and BARCODES === Overlapping Cells: 6224 Overlapping genes: 29365 adata shape: (6224, 29365) ldata shape: (6224, 29365) Cells match: True Genes match: True Layers in adata_subset: ['spliced', 'unspliced', 'ambiguous'] Spliced shape: (6224, 29365) Unspliced shape: (6224, 29365) === Seurat-derived AnnData (adata) === Cells (obs): 6224 Genes (var): 29365 First 10 cell names: ['AAACCCAAGGTACCTT', 'AAACCCAAGTCTCTGA', 'AAACGAAAGATTCGCT', 'AAACGAAAGCTCACTA', 'AAACGAAGTACTGACT', 'AAACGAAGTGTATCCA', 'AAACGAAGTTGCTCGG', 'AAACGAATCATTTGGG', 'AAACGAATCCGTATGA', 'AAACGAATCTCAACCC'] First 10 gene names: ['Xkr4', 'Gm19938', 'Sox17', 'Mrpl15', 'Lypla1', 'Tcea1', 'Rgs20', 'Atp6v1h', 'Npbwr1', '4732440D04Rik'] === Loom Spliced/Unspliced Data (ldata) === Cells (obs): 6224 Genes (var): 29365 First 10 cell names: ['AAACCCAAGGTACCTT', 'AAACCCAAGTCTCTGA', 'AAACGAAAGATTCGCT', 'AAACGAAAGCTCACTA', 'AAACGAAGTACTGACT', 'AAACGAAGTGTATCCA', 'AAACGAAGTTGCTCGG', 'AAACGAATCATTTGGG', 'AAACGAATCCGTATGA', 'AAACGAATCTCAACCC'] First 10 gene names: ['Xkr4', 'Gm19938', 'Sox17', 'Mrpl15', 'Lypla1', 'Tcea1', 'Rgs20', 'Atp6v1h', 'Npbwr1', '4732440D04Rik'] Layer Shapes in ldata spliced: (6224, 29365) unspliced: (6224, 29365) ambiguous: (6224, 29365) VelocityObject initialized successfully.
In [23]:
velocity_all = citeSEQ_all.getAdata()
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[23], line 1 ----> 1 velocity_all = citeSEQ_all.getAdata() NameError: name 'citeSEQ_all' is not defined
In [6]:
velocity_keratinocytes = citeSEQ_keratinocytes.getAdata()
velocity_keratinocytes.obsm["X_umap"] = velocity_keratinocytes.obsm["X_umap.harmony"].copy()
sc.pl.umap(velocity_keratinocytes, color="celltype", frameon=False,
legend_loc='on data', title='', save='_celltypes_rpca.pdf')
WARNING: saving figure to file figures/umap_celltypes_rpca.pdf
In [9]:
scv.pl.proportions(velocity_keratinocytes, groupby="celltype")
In [11]:
counts = velocity_keratinocytes.obs['celltype'].value_counts()
# Plot
plt.figure(figsize=(8, 4))
counts.plot(kind='bar')
plt.ylabel("Number of cells")
plt.xlabel("Cell type")
plt.title("Cell counts per cell type")
plt.xticks(rotation=45, ha='right')
plt.tight_layout()
plt.show()
In [ ]:
citeSEQ_keratinocytes.scVeloPreprocess()
Filtered out 19307 genes that are detected 20 counts (shared). WARNING: Did not normalize X as it looks processed already. To enforce normalization, set `enforce=True`. Normalized count data: spliced, unspliced.
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/preprocessing/utils.py:705: DeprecationWarning: `log1p` is deprecated since scVelo v0.3.0 and will be removed in a future version. Please use `log1p` from `scanpy.pp` instead. log1p(adata) /Users/marissaesteban/Documents/GitHub/rnavelo-CITEseq/velocity scripts/VelocityObject.py:202: DeprecationWarning: Automatic neighbor calculation is deprecated since scvelo==0.4.0 and will be removed in a future version of scVelo. Please compute neighbors first with Scanpy. scv.pp.moments(self.adata, n_pcs=30, n_neighbors=30) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/preprocessing/moments.py:71: DeprecationWarning: `neighbors` is deprecated since scvelo==0.4.0 and will be removed in a future version of scVelo. Please compute neighbors with Scanpy. neighbors(
Logarithmized X.
computing neighbors
finished (0:00:09) --> added
'distances' and 'connectivities', weighted adjacency matrices (adata.obsp)
computing moments based on connectivities
finished (0:00:11) --> added
'Ms' and 'Mu', moments of un/spliced abundances (adata.layers)
In [15]:
citeSEQ_keratinocytes.computeVelocity()
recovering dynamics (using 1/16 cores)
WARNING: Unable to create progress bar. Consider installing `tqdm` as `pip install tqdm` and `ipywidgets` as `pip install ipywidgets`,
or disable the progress bar using `show_progress_bar=False`.
finished (0:05:21) --> added
'fit_pars', fitted parameters for splicing dynamics (adata.var)
computing velocities
finished (0:00:02) --> added
'velocity', velocity vectors for each individual cell (adata.layers)
computing velocity graph (using 1/16 cores)
finished (0:00:10) --> added
'velocity_graph', sparse matrix with cosine correlations (adata.uns)
In [17]:
velocity_keratinocytes = citeSEQ_keratinocytes.getAdata()
scv.pl.velocity_embedding_grid(
velocity_keratinocytes,
basis='X_umap',
color='celltype',
dpi=150
)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [20]:
scv.pl.velocity_embedding_stream(
velocity_keratinocytes,
basis='X_umap',
color='celltype',
dpi=150
)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [22]:
scv.pl.velocity(velocity_keratinocytes, ['Cdk1'], color='celltype')
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/numpy/core/fromnumeric.py:57: DeprecationWarning: Passing `np.nan` to mean no clipping in np.clip has always been unreliable, and is now deprecated. In future, this will always return nan, like it already does when min or max are arrays that contain nan. To skip a bound, pass either None or an np.inf of an appropriate sign. return bound(*args, **kwds)
KERATINOCYTES SUBSET TO UNWOUNDED¶
In [18]:
keratinocytes_uw = citeSEQ_keratinocytes_uw.getAdata()
keratinocytes_uw.obsm["X_umap"] = keratinocytes_uw.obsm["X_umap_uw"].copy()
sc.pl.umap(keratinocytes_uw, color="celltype", frameon=False,
legend_loc='on data', title='', save='_celltypes_rpca.pdf')
WARNING: saving figure to file figures/umap_celltypes_rpca.pdf
In [ ]:
citeSEQ_keratinocytes_uw.scVeloPreprocess()
citeSEQ_keratinocytes_uw.computeVelocity()
Filtered out 21202 genes that are detected 20 counts (shared). WARNING: Did not normalize X as it looks processed already. To enforce normalization, set `enforce=True`. Normalized count data: spliced, unspliced. Logarithmized X. computing neighbors
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/preprocessing/utils.py:705: DeprecationWarning: `log1p` is deprecated since scVelo v0.3.0 and will be removed in a future version. Please use `log1p` from `scanpy.pp` instead. log1p(adata) /Users/marissaesteban/Documents/GitHub/rnavelo-CITEseq/velocity scripts/VelocityObject.py:203: DeprecationWarning: Automatic neighbor calculation is deprecated since scvelo==0.4.0 and will be removed in a future version of scVelo. Please compute neighbors first with Scanpy. scv.pp.moments(self.adata, n_pcs=30, n_neighbors=30) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/preprocessing/moments.py:71: DeprecationWarning: `neighbors` is deprecated since scvelo==0.4.0 and will be removed in a future version of scVelo. Please compute neighbors with Scanpy. neighbors(
finished (0:00:02) --> added
'distances' and 'connectivities', weighted adjacency matrices (adata.obsp)
computing moments based on connectivities
finished (0:00:03) --> added
'Ms' and 'Mu', moments of un/spliced abundances (adata.layers)
recovering dynamics (using 1/16 cores)
WARNING: Unable to create progress bar. Consider installing `tqdm` as `pip install tqdm` and `ipywidgets` as `pip install ipywidgets`,
or disable the progress bar using `show_progress_bar=False`.
finished (0:02:00) --> added
'fit_pars', fitted parameters for splicing dynamics (adata.var)
computing velocities
finished (0:00:00) --> added
'velocity', velocity vectors for each individual cell (adata.layers)
computing velocity graph (using 1/16 cores)
finished (0:00:02) --> added
'velocity_graph', sparse matrix with cosine correlations (adata.uns)
In [14]:
scv.pl.velocity_embedding_stream(
keratinocytes_uw,
basis='X_umap',
color='celltype',
dpi=150
)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [13]:
keratinocytes_uw = citeSEQ_keratinocytes_uw.getAdata()
scv.pl.velocity_embedding_grid(
keratinocytes_uw,
basis='X_umap',
color='celltype',
dpi=150
)
computing velocity embedding
finished (0:00:00) --> added
'velocity_umap', embedded velocity vectors (adata.obsm)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
using new embeddings¶
KERATINOCYTES SUBSET TO WOUNDED¶
In [16]:
keratinocytes_wo = citeSEQ_keratinocytes_wo.getAdata()
keratinocytes_wo.obsm["X_umap"] = keratinocytes_wo.obsm["X_umap_wo"].copy()
sc.pl.umap(keratinocytes_wo, color="celltype", frameon=False,
legend_loc='on data', title='', save='_celltypes_rpca.pdf')
WARNING: saving figure to file figures/umap_celltypes_rpca.pdf
In [ ]:
citeSEQ_keratinocytes_wo.scVeloPreprocess()
citeSEQ_keratinocytes_wo.computeVelocity()
Filtered out 19990 genes that are detected 20 counts (shared). WARNING: Did not normalize X as it looks processed already. To enforce normalization, set `enforce=True`. Normalized count data: spliced, unspliced. Logarithmized X. computing neighbors
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/preprocessing/utils.py:705: DeprecationWarning: `log1p` is deprecated since scVelo v0.3.0 and will be removed in a future version. Please use `log1p` from `scanpy.pp` instead. log1p(adata) /Users/marissaesteban/Documents/GitHub/rnavelo-CITEseq/velocity scripts/VelocityObject.py:203: DeprecationWarning: Automatic neighbor calculation is deprecated since scvelo==0.4.0 and will be removed in a future version of scVelo. Please compute neighbors first with Scanpy. scv.pp.moments(self.adata, n_pcs=30, n_neighbors=30) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/preprocessing/moments.py:71: DeprecationWarning: `neighbors` is deprecated since scvelo==0.4.0 and will be removed in a future version of scVelo. Please compute neighbors with Scanpy. neighbors(
finished (0:00:07) --> added
'distances' and 'connectivities', weighted adjacency matrices (adata.obsp)
computing moments based on connectivities
finished (0:00:07) --> added
'Ms' and 'Mu', moments of un/spliced abundances (adata.layers)
recovering dynamics (using 1/16 cores)
finished (0:03:27) --> added
'fit_pars', fitted parameters for splicing dynamics (adata.var)
computing velocities
finished (0:00:01) --> added
'velocity', velocity vectors for each individual cell (adata.layers)
computing velocity graph (using 1/16 cores)
finished (0:00:05) --> added
'velocity_graph', sparse matrix with cosine correlations (adata.uns)
In [20]:
scv.pl.velocity_embedding_stream(
keratinocytes_wo,
basis='X_umap',
color='celltype',
dpi=150
)
computing velocity embedding
finished (0:00:00) --> added
'velocity_umap', embedded velocity vectors (adata.obsm)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [21]:
keratinocytes_wo = citeSEQ_keratinocytes_wo.getAdata()
scv.pl.velocity_embedding_grid(
keratinocytes_wo,
basis='X_umap',
color='celltype',
dpi=150
)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
More testing with adata objects¶
In [ ]:
keratinocytes_uw = citeSEQ_keratinocytes_uw.getAdata()
keratinocytes_wo = citeSEQ_keratinocytes_wo.getAdata()
In [38]:
scv.tl.rank_velocity_genes(keratinocytes_uw, groupby='celltype', min_corr=.3)
df = pd.DataFrame(keratinocytes_uw.uns['rank_velocity_genes']['names'])
df.head()
ranking velocity genes
finished (0:00:00) --> added
'rank_velocity_genes', sorted scores by group ids (adata.uns)
'spearmans_score', spearmans correlation scores (adata.var)
Out[38]:
| Ker.Cycling I | Ker.Cycling II | Ker.Cycling III | IRS I | IRS II | Medulla | Cortex | Outer Bulge I | Outer Bulge II | Outer Bulge III | ... | Basal I | Basal II | Basal III | Basal IV | uHF I | uHF II | Spinous I | Spinous II | Spinous III | Spinous IV | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Plek2 | Rp9 | Krt80 | Mgst1 | Plek2 | Jpt1 | Rps11 | Ptbp1 | Oxct1 | Serpinb5 | ... | Plek2 | Ptgs1 | Nedd4 | Prdx2 | Sf3b6 | Sf3b6 | Sar1b | Sar1b | Trib1 | Uchl3 |
| 1 | Reep5 | Plek2 | Gltp | Cfl1 | Hspb8 | Bok | Cstb | Reep5 | Atp2b4 | Gng12 | ... | Tagln2 | Prnp | Pkib | Elovl7 | Uchl3 | Bzw1 | Cd44 | Cd44 | Tecr | Ywhaq |
| 2 | Golim4 | Ctsb | Rnf11 | Tuba4a | Tpm4 | Tagln2 | Tagln2 | Atp2b4 | Wnt4 | Jup | ... | Pkp1 | Dstn | Rcc2 | Rpl35a | Tkt | Tkt | Epcam | Serpinb2 | Snrpg | Acat1 |
| 3 | Notch1 | Golim4 | Npc2 | Jpt1 | Tagln2 | Tpm4 | Pof1b | Oxct1 | Ybx3 | S100a11 | ... | Cstb | Fst | Rgcc | Acat1 | Mak16 | Elovl4 | Calm2 | Hs3st1 | Dusp7 | Dstn |
| 4 | S100a11 | Notch1 | Notch1 | Prkar1a | Pkp1 | Ralbp1 | B2m | Bbox1 | Gng12 | Mbd2 | ... | Hspb8 | Sema3c | Slc12a2 | Anapc5 | Bzw1 | Hspe1 | Ptp4a2 | Epcam | Mt2 | Gnai1 |
5 rows × 22 columns
In [64]:
scv.tl.rank_velocity_genes(keratinocytes_wo, groupby='celltype', min_corr=.3)
df = pd.DataFrame(keratinocytes_wo.uns['rank_velocity_genes']['names'])
df.head()
ranking velocity genes
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/tools/utils.py:463: DeprecationWarning: Please import `rankdata` from the `scipy.stats` namespace; the `scipy.stats.stats` namespace is deprecated and will be removed in SciPy 2.0.0. from scipy.stats.stats import rankdata
finished (0:00:10) --> added
'rank_velocity_genes', sorted scores by group ids (adata.uns)
'spearmans_score', spearmans correlation scores (adata.var)
Out[64]:
| Ker.Cycling I | Ker.Cycling II | Ker.Cycling III | IRS I | IRS II | Medulla | Cortex | Outer Bulge I | Outer Bulge II | Outer Bulge III | ... | Basal II | Basal III | Basal IV | uHF I | uHF II | Spinous I | Spinous II | Spinous III | Spinous IV | Cornified | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Anxa5 | Mki67 | Nedd4 | Eif6 | Tmem45a | Tagln2 | Acaa2 | Actn1 | Filip1l | Pdzrn3 | ... | Efnb1 | Nedd4 | Macroh2a1 | Uchl3 | Uchl3 | Ppp1r14c | Serpinb2 | Serpinb2 | Sf3b6 | Igfbp3 |
| 1 | Fkbp1a | Notch1 | Notch1 | Bok | Acaa2 | Anxa5 | Ckmt1 | Anxa8 | Timp3 | Lgals3 | ... | Hras | Dsg1a | Oxct1 | Macroh2a1 | Hopx | Serpinb2 | Mt1 | Actr2 | Anxa2 | Serpinb2 |
| 2 | Slc7a8 | Lypd3 | Cebpa | Txndc17 | Cux1 | Plp2 | Pkp1 | Pdzrn3 | Lgals3 | Slc12a2 | ... | Trib1 | Tob1 | Hspb8 | Vdr | Adamts1 | Actr2 | Hif1a | Hif1a | Prkar1a | Rps25 |
| 3 | Tsc22d1 | Golim4 | Lima1 | Efnb1 | Gm49425 | Wdr1 | Psmb4 | Smc6 | Rnf217 | Lsm4 | ... | Dsp | Anapc5 | Eef1g | Anxa2 | Itprid2 | Itprid2 | Sfr1 | Hopx | Sap18 | Clca3a2 |
| 4 | Golim4 | Perp | Vgll4 | Rab11a | Chmp2b | Rai14 | Lypd3 | Rai14 | Creb5 | Actn1 | ... | Fst | Macroh2a1 | 1810037I17Rik | Sap18 | Eif5 | Il33 | Ppp1r14c | Hbegf | Uchl3 | Cyp51 |
5 rows × 23 columns
In [40]:
scv.pl.velocity(keratinocytes_uw, ['Plek2', 'Reep5', 'Golim4'], ncols=1, color='celltype')
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [41]:
scv.pl.velocity(keratinocytes_wo, ['Plek2', 'Reep5', 'Golim4'], ncols=1, color='celltype')
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/numpy/core/fromnumeric.py:57: DeprecationWarning: Passing `np.nan` to mean no clipping in np.clip has always been unreliable, and is now deprecated. In future, this will always return nan, like it already does when min or max are arrays that contain nan. To skip a bound, pass either None or an np.inf of an appropriate sign. return bound(*args, **kwds) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [42]:
scv.tl.score_genes_cell_cycle(keratinocytes_wo)
scv.pl.scatter(keratinocytes_wo, color_gradients=['S_score', 'G2M_score'], smooth=True, perc=[5, 95])
calculating cell cycle phase --> 'S_score' and 'G2M_score', scores of cell cycle phases (adata.obs)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [43]:
scv.tl.score_genes_cell_cycle(keratinocytes_uw)
scv.pl.scatter(keratinocytes_uw, color_gradients=['S_score', 'G2M_score'], smooth=True, perc=[5, 95])
calculating cell cycle phase --> 'S_score' and 'G2M_score', scores of cell cycle phases (adata.obs)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [74]:
# stress genes: Fos, Jun Atf3, Egr1, IL1A
gene = 'Ptgs2'
if gene in keratinocytes_wo.var_names:
scv.pl.velocity(
keratinocytes_wo,
var_names=[gene],
basis='umap',
color='celltype'
)
else:
print("Gene not in adata")
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/numpy/core/fromnumeric.py:57: DeprecationWarning: Passing `np.nan` to mean no clipping in np.clip has always been unreliable, and is now deprecated. In future, this will always return nan, like it already does when min or max are arrays that contain nan. To skip a bound, pass either None or an np.inf of an appropriate sign. return bound(*args, **kwds)
In [75]:
# Proliferation genes: Mki67, Top2a, Cenpf, Pcna
gene = 'Top2a'
if gene in keratinocytes_uw.var_names:
scv.pl.velocity(
keratinocytes_uw,
var_names=[gene],
basis='umap',
color='celltype'
)
else:
print("Gene not in adata")
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/numpy/core/fromnumeric.py:57: DeprecationWarning: Passing `np.nan` to mean no clipping in np.clip has always been unreliable, and is now deprecated. In future, this will always return nan, like it already does when min or max are arrays that contain nan. To skip a bound, pass either None or an np.inf of an appropriate sign. return bound(*args, **kwds)
UN WOUNDED IFE¶
In [38]:
h5ad_path = "/Volumes/PortableSSD/SRSP/CITEseq_Keratinocytes/UW_IFE.h5ad"
loom_paths = ["/Volumes/PortableSSD/SRSP/CITEseq_looms/YS001/possorted_genome_bam_KLWV0.loom",
"/Volumes/PortableSSD/SRSP/CITEseq_looms/YS002/possorted_genome_bam_PNEM4.loom",
"/Volumes/PortableSSD/SRSP/CITEseq_looms/YS003/possorted_genome_bam_8Q2XV.loom",
"/Volumes/PortableSSD/SRSP/CITEseq_looms/YS004/possorted_genome_bam_0XB2N.loom",
"/Volumes/PortableSSD/SRSP/CITEseq_looms/YS005/possorted_genome_bam_HX08G.loom",
"/Volumes/PortableSSD/SRSP/CITEseq_looms/YS006/possorted_genome_bam_751VB.loom"]
citeSEQ_Keratinocytes_IFE = VelocityObject(h5ad_path, loom_paths)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/utils.py:11: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
logging.warn(f"â•── " + message)
WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/utils.py:12: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
logging.warn(f"╰──> at {frameinfo[2].filename}, line {frameinfo[2].lineno}")
WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471
WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead
WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471
WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead
WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471
WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead
WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471
WARNING:root:â•── 'batch_scan_layers' is deprecated. Use 'scan' instead
WARNING:root:╰──> at /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/loompy/loompy.py, line 471
WARNING:biothings.client:Input sequence provided is already in string format. No operation performed
WARNING:biothings.client:Input sequence provided is already in string format. No operation performed
INFO:biothings.client:querying 1-248 ...
==== Converting ENSEMBL Genes ==== Total ldata genes: 33696 ENSEMBL-like genes: 248 Already-symbol-like genes: 33448
INFO:biothings.client:Finished. WARNING:biothings.client:13 input query terms found no hit: ['ENSMUSG00000095742', 'ENSMUSG00000095728', 'ENSMUSG00000095076', 'ENSMUSG00000121317', 'ENSMUSG000 INFO:biothings.client:Pass "returnall=True" to return complete lists of duplicate or missing query terms.
Mapped ENSMUSG → symbol: 203 Unmapped ENSMUSG: 45 Total ENSMUSG IDs after mapping: 45 === Removing duplicates === adata Cells (original): 3854 Genes (original): 30481 Duplicate cell barcodes: 0 Duplicate genes: 0 ldata Cells (original): 45487 Genes (original): 33696 Duplicate cell barcodes: 235 Duplicate genes: 27 adata after dedup: (3854, 30481) ldata after dedup: (45252, 33696) === Subsetting cells by GENES and BARCODES === Overlapping Cells: 3794 Overlapping genes: 29365 adata shape: (3794, 29365) ldata shape: (3794, 29365) Cells match: True Genes match: True Layers in adata_subset: ['spliced', 'unspliced', 'ambiguous'] Spliced shape: (3794, 29365) Unspliced shape: (3794, 29365) === Seurat-derived AnnData (adata) === Cells (obs): 3794 Genes (var): 29365 First 10 cell names: ['AAACGAAAGATTCGCT', 'AAACGAAAGCTCACTA', 'AAACGAAGTGTATCCA', 'AAACGAAGTTGCTCGG', 'AAACGAATCTCAACCC', 'AAACGCTCAAGAGATT', 'AAACGCTGTAGGTCAG', 'AAACGCTTCGCACTCT', 'AAAGAACCAACCGGAA', 'AAAGAACCATACAGAA'] First 10 gene names: ['Xkr4', 'Gm19938', 'Sox17', 'Mrpl15', 'Lypla1', 'Tcea1', 'Rgs20', 'Atp6v1h', 'Npbwr1', '4732440D04Rik'] === Loom Spliced/Unspliced Data (ldata) === Cells (obs): 3794 Genes (var): 29365 First 10 cell names: ['AAACGAAAGATTCGCT', 'AAACGAAAGCTCACTA', 'AAACGAAGTGTATCCA', 'AAACGAAGTTGCTCGG', 'AAACGAATCTCAACCC', 'AAACGCTCAAGAGATT', 'AAACGCTGTAGGTCAG', 'AAACGCTTCGCACTCT', 'AAAGAACCAACCGGAA', 'AAAGAACCATACAGAA'] First 10 gene names: ['Xkr4', 'Gm19938', 'Sox17', 'Mrpl15', 'Lypla1', 'Tcea1', 'Rgs20', 'Atp6v1h', 'Npbwr1', '4732440D04Rik'] Layer Shapes in ldata spliced: (3794, 29365) unspliced: (3794, 29365) ambiguous: (3794, 29365) VelocityObject initialized successfully.
In [39]:
velocity_ker_ife = citeSEQ_Keratinocytes_IFE.getAdata()
scv.pl.proportions(velocity_ker_ife, groupby="celltype")
In [54]:
# pre process and compute velocity
citeSEQ_Keratinocytes_IFE.scVeloPreprocess(n_pcs=20)
citeSEQ_Keratinocytes_IFE.computeVelocity()
Filtered out 73 genes that are detected 20 counts (spliced). WARNING: Did not normalize X as it looks processed already. To enforce normalization, set `enforce=True`. WARNING: Did not normalize spliced as it looks processed already. To enforce normalization, set `enforce=True`. WARNING: Did not normalize unspliced as it looks processed already. To enforce normalization, set `enforce=True`. WARNING: adata.X seems to be already log-transformed. Logarithmized X. computing moments based on connectivities
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/preprocessing/utils.py:705: DeprecationWarning: `log1p` is deprecated since scVelo v0.3.0 and will be removed in a future version. Please use `log1p` from `scanpy.pp` instead. log1p(adata)
finished (0:00:02) --> added
'Ms' and 'Mu', moments of un/spliced abundances (adata.layers)
recovering dynamics (using 1/16 cores)
finished (0:00:52) --> added
'fit_pars', fitted parameters for splicing dynamics (adata.var)
computing velocities
finished (0:00:00) --> added
'velocity', velocity vectors for each individual cell (adata.layers)
computing velocity graph (using 1/16 cores)
finished (0:00:01) --> added
'velocity_graph', sparse matrix with cosine correlations (adata.uns)
In [55]:
velocity_ker_ife.obsm["X_umap"] = velocity_ker_ife.obsm["X_umap.harmony"].copy()
scv.pl.velocity_embedding_stream(
velocity_ker_ife,
basis='X_umap',
color='celltype',
palette="tab20",
dpi=150
)
computing velocity embedding
finished (0:00:00) --> added
'velocity_umap', embedded velocity vectors (adata.obsm)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [56]:
scv.pl.velocity_embedding_grid(
velocity_ker_ife,
basis='X_umap',
color='celltype',
palette="tab20",
dpi=150
)
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])
In [47]:
scv.tl.rank_velocity_genes(velocity_ker_ife, groupby='celltype', min_corr=.3)
df = pd.DataFrame(velocity_ker_ife.uns['rank_velocity_genes']['names'])
df.head(8)
ranking velocity genes
finished (0:00:00) --> added
'rank_velocity_genes', sorted scores by group ids (adata.uns)
'spearmans_score', spearmans correlation scores (adata.var)
Out[47]:
| Ker.Cycling I | Ker.Cycling II | Ker.Cycling III | Basal II | Basal III | Basal IV | Spinous I | Spinous II | Spinous III | Spinous IV | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Plek2 | Plek2 | Krt80 | Ptgs1 | Smagp | Lgals3 | Sar1b | Ifi202b | Mt2 | Ywhaq |
| 1 | S100a11 | Mki67 | Pkp1 | Prnp | H2bc4 | Ywhaq | Prmt1 | Arhgdib | H2aj | Uchl3 |
| 2 | Dpy30 | Sdc1 | H2bc4 | Sema3c | Nedd4 | Nudc | Dek | Sar1b | Lrrc59 | Nudc |
| 3 | Pkp1 | Tagln2 | Nr4a1 | Cct6a | Pkib | Lmo4 | Ptp4a2 | Sprr1b | Tecr | Lgals3 |
| 4 | Tmprss4 | Rp9 | Maff | Atp2b1 | Tuba1b | Pkib | Igfbp3 | Il33 | Ak2 | Tkt |
| 5 | Col17a1 | Pkp1 | Slc12a2 | Itgb1 | Ldha | Oxct1 | Hspd1 | Cd44 | Rsl1d1 | Sugt1 |
| 6 | Csrp1 | Cnih4 | Bcl11b | Rexo2 | Rcc2 | Hoxa7 | Uchl3 | Uchl3 | Rabac1 | Acat1 |
| 7 | Bcl11b | S100a11 | Atp2b4 | Cxcl14 | Slc12a2 | Smagp | Il33 | Serpinb2 | Atf3 | Hagh |
In [48]:
import scanpy as sc
gene = "Krt14" # change me
genes = ["Krt14", "Krt1", "Cdk1", "Trp63", "Fos", "Cdkn1a"]
sc.pl.embedding(
velocity_ker_ife,
basis="umap",
color=genes,
ncols=3 # 3 columns × 2 rows
)
In [51]:
scv.pl.velocity(velocity_ker_ife, ['Smagp', 'H2bc4', 'Nedd4'], ncols=1, color='celltype')
/opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c]) /opt/miniconda3/envs/scvelo_env/lib/python3.10/site-packages/scvelo/plotting/utils.py:68: DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead return isinstance(c, str) and c in data.obs.keys() and cat(data.obs[c])